package com.wugui.datax.admin.tool.datax.reader;

import com.google.common.collect.Maps;
import com.wugui.datax.admin.tool.pojo.DataxExcelPojo;

import java.util.Map;

/****************************************
 *
 *@Author: wangzp
 *@Date: 2023/8/2 周三 14:02
 *@Desc:
 *
 *****************************************/

public class ExcelReader extends BaseReaderPlugin implements DataxReaderInterface{
    @Override
    public String getName() {
        return "excelreader";
    }

    @Override
    public Map<String, Object> sample() {
        return null;
    }

    @Override
    public Map<String,Object> buildExcel(DataxExcelPojo plugin){
        //构建
        Map<String, Object> readerObj = Maps.newLinkedHashMap();
        readerObj.put("name",getName());

        Map<String, Object> parameterObj = Maps.newLinkedHashMap();

        parameterObj.put("path",plugin.getPath());
        parameterObj.put("skipHeader",1);
        parameterObj.put("column", plugin.getColumn());

        readerObj.put("parameter", parameterObj);

        return readerObj;
    }
}
